<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>

    //需求：把字符串转成数字


    var str = '88';
    //强制类型转换
    var num1 = Number(str);
    var num2 = parseInt(str);
    //隐式类型转换：用运算符进行转换
    var num3 = str - 0;
    var num4 = str * 1;
    var num5 = str / 1;
    console.log(typeof num1,num2,num3,num4,num5);
</script>
</html>